package com.fishery.processing.mapper;

import com.fishery.processing.entity.Job;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fishery.processing.entity.root.JobRootVo;
import com.fishery.processing.entity.vo.JobVo;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author run
 * @since 2021-03-12
 */
public interface JobMapper extends BaseMapper<Job> {

    @Select("SELECT gmt_create AS start_time, complete_time AS end_time, product_id, operator_name " +
            "FROM t_processing_job WHERE id = #{jobId}")
    public JobRootVo getJobRootMessage(String jobId);

    @Select("SELECT id, material_id, material_weight, product_id, product_weight, job_description, complete_time" +
            ", operator_name, processing_factory_id FROM t_processing_job WHERE id = #{jobId}")
    public JobVo getJobById(String jobId);
}
